package cc.yugu.yhdw.webserver.service.hdw;

import cc.yugu.yhdw.common.domain.hdw.BatteryForegift;
import cc.yugu.yhdw.common.entity.json.ExtResult;
import cc.yugu.yhdw.webserver.persistence.hdw.BatteryForegiftMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
 * 电池押金信息业务
 *
 * @Date:Created in 2018/7/5 16:25
 * @Author:
 * @Modified By: zjn 2018/7/5 16:25
 */
@Service
public class BatteryForegiftService {

    @Autowired
    BatteryForegiftMapper batteryForegiftMapper;

    public BatteryForegift find() {
        return batteryForegiftMapper.find();
    }
    /**
    * 更新余额
    *
    * @Param: [money]
    * @Return: cc.yugu.yhdw.common.entity.json.ExtResult
    * @Author By: zjn 2018/7/5  16:25
    */
    @Transactional(rollbackFor=Throwable.class)
    public ExtResult update( double money) {

        batteryForegiftMapper.update(money);
        return ExtResult.successResult();
    }
}
